package com._58city.spark.app.ext.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

import com._58city.spark.app.ext.dto.BelongCate;
import com._58city.spark.app.ext.dto.DispCity;
import com._58city.spark.app.ext.dto.ImcInfoSource;



/**
 * @author huangliang
 * IMC来源归属关系DAO
 */
public class ImcInfoSourceDao extends BaseDao implements ParameterizedRowMapper<ImcInfoSource>{
	
	public List<ImcInfoSource> select_all(){
		String sql = String.format("select * from %s", super.tableName);
		List<ImcInfoSource> result = this.jdbcTemplate.query(sql, this);
		if (null != result) {
			return result;
		} else {
			return new ArrayList<ImcInfoSource>();
		}
	}

	public ImcInfoSource mapRow(ResultSet rs, int rowNum) throws SQLException {
		
		ImcInfoSource res = new ImcInfoSource();
		res.setSource(rs.getString("source"));
		res.setPlatform(rs.getString("platform"));
		res.setSource_name(rs.getString("source_name"));
		return res;
	}
	

}
